accessing module attribute value without opening module

Since I am able to view the module-level attribute values from the module properties without opening the module, I would assume I could do the same in DXL. Anyone know how to do this in DXL?
DanMott - Wed May 23 11:18:42 EDT 2012

Re: accessing module attribute value without opening module
llandale - Thu May 24 13:41:51 EDT 2012

See the "ModuleProperties" section under chapter "Modules" in the DXL manual. You need first get a "ModuleVersion" handle on the un-opened module.

ModuleProperties fail rudely when dealing with module-level Attr-DXL; unless that dxl is written robustly.

-Louie

Re: accessing module attribute value without opening module
DanMott - Fri May 25 12:15:07 EDT 2012

llandale - Thu May 24 13:41:51 EDT 2012
See the "ModuleProperties" section under chapter "Modules" in the DXL manual. You need first get a "ModuleVersion" handle on the un-opened module.

ModuleProperties fail rudely when dealing with module-level Attr-DXL; unless that dxl is written robustly.

-Louie

Thank you!! Exactly what I needed.

Re: accessing module attribute value without opening module
DanMott - Fri May 25 14:34:08 EDT 2012

DanMott - Fri May 25 12:15:07 EDT 2012
Thank you!! Exactly what I needed.

So I've been using ModuleVersion and ModuleProperties to access the module level attribute values. However, when I ran the script across the entire database, I run into memory exhaust errors. I looked into this closer and it seems that the getProperties(mv,mp) function is the culprit, since when I uncommented that line the memory started growing during execution. I tried "delete mp" which threw a DXL error -- any clue how to clean up the memory when I'm iterating over the entire database?

Re: accessing module attribute value without opening module
llandale - Fri May 25 15:55:58 EDT 2012

DanMott - Fri May 25 14:34:08 EDT 2012
So I've been using ModuleVersion and ModuleProperties to access the module level attribute values. However, when I ran the script across the entire database, I run into memory exhaust errors. I looked into this closer and it seems that the getProperties(mv,mp) function is the culprit, since when I uncommented that line the memory started growing during execution. I tried "delete mp" which threw a DXL error -- any clue how to clean up the memory when I'm iterating over the entire database?

I see no such "delete(ModuleProperties)" command. But it seems unlikely you have so many modules in your database that the number of such lingering allocated units matters. Are there 10,000 modules?

If the bottom logic produces a "string", you could do the ModuleProperties stuff inside an "eval_" string. You will get a jump in processing time, but a constant one not an exponential one.

-Louie

Re: accessing module attribute value without opening module
DanMott - Fri May 25 18:13:32 EDT 2012

llandale - Fri May 25 15:55:58 EDT 2012
I see no such "delete(ModuleProperties)" command. But it seems unlikely you have so many modules in your database that the number of such lingering allocated units matters. Are there 10,000 modules?

If the bottom logic produces a "string", you could do the ModuleProperties stuff inside an "eval_" string. You will get a jump in processing time, but a constant one not an exponential one.

-Louie

Actually, there's more than 20,000 modules.

Thanks for the idea on using "eval_". I was successfully able to process the entire database without an increase in memory usage. I suspect that the memory is released after the eval_ command is finished executing.

Only minimal impact to execution time.

Two things to note with the eval_ command... 1) you can't reference variables outside the eval_ code you are running, unless you access the memory location of the variable. For example...

string myCode = "string modName = addr_ " ((addr_ modName) int) ""

2) you can't update the value of an outside variable even if you access it in this manner because for basic data types it will create a new variable for a new string. Instead, you'd have to use something like an Array or Skip List so that the memory location stays constant as you update the variable.

Thanks for your help Louie!

Re: accessing module attribute value without opening module
llandale - Mon May 28 13:38:27 EDT 2012

DanMott - Fri May 25 18:13:32 EDT 2012
Actually, there's more than 20,000 modules.

Thanks for the idea on using "eval_". I was successfully able to process the entire database without an increase in memory usage. I suspect that the memory is released after the eval_ command is finished executing.

Only minimal impact to execution time.

Two things to note with the eval_ command... 1) you can't reference variables outside the eval_ code you are running, unless you access the memory location of the variable. For example...

string myCode = "string modName = addr_ " ((addr_ modName) int) ""

2) you can't update the value of an outside variable even if you access it in this manner because for basic data types it will create a new variable for a new string. Instead, you'd have to use something like an Array or Skip List so that the memory location stays constant as you update the variable.

Thanks for your help Louie!

I see that there are now two people in the world that grasp cheating memory within "eval_"; I'm not one of them!